﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RailwayReservationWeb.employee
{
    public partial class logout : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string rdr;
                if (Request.QueryString["rdr"] != null)
                    rdr = Request.QueryString["rdr"].ToString();
                else if (Request.UrlReferrer != null)
                    rdr = Request.UrlReferrer.ToString();
                else rdr = "~/employee/default.aspx";
                Response.Cookies.Remove("authinfo");
                Session.Remove("authinfo");
                Response.Redirect("~/employee/login.aspx?rdr=" + rdr);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
    }
}